
import request from '../../../apis/axios'
// 获取远程数据
export function getRemoteData(method = 'get', path, params,apiHeader) {
  let data = method.toLocaleLowerCase() === 'get' ? 'params' : 'data'
  let config ={
    url: path,
    method: method,
    [data]: params
  }
  if(apiHeader){
    config.headers =apiHeader
  }
  return request(config)
}

// 获取远程数据
export function getTableData (method='post',path, data,apiHeader) {
  let dataKey = method.toLocaleLowerCase() === 'get' ? 'params' : 'data'
  let config = {
    url: path,
    method,
    [dataKey]: data
  }
  if(apiHeader){
    config.headers =apiHeader
  }
  return request(config)
}